package com.thanhloyal.exchanger;

public class RateDataItem {

	private String pair;
	private double askRate;
	private double bidRate;
	
	public RateDataItem(String pair, double askRate, double bidRate) {
		super();
		this.pair = pair;
		this.askRate = askRate;
		this.bidRate = bidRate;
	}

	public String getFirstCode(){
		int slashPos = pair.indexOf('/');
		return pair.substring(0, slashPos);
	}
	
	public String getSecondCode(){
		int slashPos = pair.indexOf('/');
		return pair.substring(slashPos + 1);
	}
	
	public String getPair() {
		return pair;
	}

	public void setPair(String pair) {
		this.pair = pair;
	}

	public double getAskRate() {
		return askRate;
	}

	public void setAskRate(double askRate) {
		this.askRate = askRate;
	}

	public double getBidRate() {
		return bidRate;
	}

	public void setBidRate(double bidRate) {
		this.bidRate = bidRate;
	}
	
	
}
